/*Author: Rony Lahav (ID:043489889)*/

/**
 * Activates the AT command by running ATManager with received intervals
 */
public class CmdAT implements ICmd{
	
	private String intervals;
	
	public CmdAT(String intervals){
		this.intervals=intervals;
	}
	
	/*updates AT intervals for printing*/
	public void executeCmd(){
		if (!final_project.isShutDown()){
			String[] splittedIntervals=intervals.split(",");
			int[] intervalsInt = new int[splittedIntervals.length];
			for (int i=0;i<splittedIntervals.length;++i) {
				intervalsInt[i]=Integer.parseInt(splittedIntervals[i]);
			}
			final_project.activateATThread(intervalsInt);
		}
	}
}
